<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="title" width="600px" :visible.sync="editVisible"
    :before-close="function(){editVisible = false}" append-to-body>
    <div v-loading="load">
        <el-form ref="editForm" :model="form" label-width="100px" label-position="left">
            
            <!-- sore -->
            <LayoutCell v-show="$vFN.Tools.getProjectType() == 'site'">

                <el-form-item label="收银台状态" prop="status" v-show="editType == 'basic'">
                    <el-radio-group v-model="form.status">
                        <el-radio :label="1">开启</el-radio>
                        <el-radio :label="0">关闭</el-radio>
                      </el-radio-group>
                </el-form-item>

                <el-form-item label="选择门店" 
                              prop="store_id" 
                              :rules="{ required: true, message: '请选择门店'}" 
                              v-show="editType == 'add'">
                    <SelectDataStore v-model="form.store_id"  :appWindow="appWindow" :count="1" ></SelectDataStore>
                </el-form-item>

                <el-form-item label="平台提成" 
                              prop="cost_ratio" 
                             :rules="[{ required: true, trigger: ['blur', 'change'],validator:function(rule, value, callback){validatorNumber(rule, value, callback)}}]" >
                    <el-input v-model="form.cost_ratio" style="width: 200px;"><template slot="append">%</template> </el-input>
                </el-form-item>

                <el-form-item label="支付方式" v-show="editType == 'basic'">
                    <el-checkbox-group v-model="form.pay_type">
                        <el-checkbox v-for="item in payTypeList" :label="item.type">{{item.name}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>

                <el-form-item label="选择抵扣" prop="integral" v-show="editType == 'basic'">
                    <el-checkbox-group v-model="form.integral" v-if="integralList.length > 0">
                        <el-checkbox v-for="item in integralList" :label="item.id">{{item.name}}</el-checkbox>
                    </el-checkbox-group>
                    <span v-if="integralList.length == 0">暂无抵扣</span>
                </el-form-item>

            </LayoutCell>

            <!-- site -->
            <LayoutCell v-show="$vFN.Tools.getProjectType() == 'store'">
                <el-form-item label="收银台状态" prop="status" v-if="editType == 'basic'">
                    <el-radio-group v-model="form.status">
                        <el-radio :label="1">开启</el-radio>
                        <el-radio :label="0">关闭</el-radio>
                      </el-radio-group>
                </el-form-item>
             
                <el-form-item label="选择抵扣" prop="integral" v-if="editType == 'basic'">
                    <el-checkbox-group v-model="form.integral">
                        <el-checkbox v-for="item in integralList" :label="item.id">{{item.name}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
            </LayoutCell>

        </el-form>
    </div>
    <div slot="footer">
        <el-row>
            <el-col :span="12" style="text-align: left;">
                <el-button @click="editVisible = false">取 消</el-button>
            </el-col>
            <el-col :span="12">
                <el-button type="primary" @click="add()" v-show="editType == 'add'">添加</el-button>
                <el-button type="primary" @click="sum()" v-show="editType == 'basic'">确定</el-button>
                <el-button type="primary" @click="amend()" v-show="editType == 'update'">修改</el-button>
            </el-col>
        </el-row>
    </div>
</el-dialog>